package org.nfr;

import org.semanticweb.owlapi.model.OWLOntology;
import openllet.owlapi.OpenlletReasonerFactory;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;

public class RuleEngine {
    private final OWLOntology inferredOntology;
    private final OWLReasoner reasoner;

    public RuleEngine(OWLOntology ontology) {
        OWLReasonerFactory reasonerFactory = OpenlletReasonerFactory.getInstance();
        this.reasoner = reasonerFactory.createReasoner(ontology);
        this.reasoner.precomputeInferences();
        this.inferredOntology = ontology;
        System.out.println("✅ SWRL 推理完成");
    }

    public OWLOntology getInferredOntology() {
        return inferredOntology;
    }

    public OWLReasoner getReasoner() {
        return reasoner;
    }

    public void applyRules() {
        System.out.println("[Info] SWRL 规则不需要单独加载，已由 Pellet 自动应用");
    }
}
